import { INCREMENT, SUBTRACT } from './action-types';

export function counter(state = 0, action) {
	switch (action.type) {
		case INCREMENT:
			return state + action.data;
		case SUBTRACT:
			return state - action.data;
		default:
			return state;
	}

}
